package HelloSeries.routine;

import java.util.ArrayList;
import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;

import org.apache.log4j.Logger;

import HelloSeries.HelloSeries;
import HelloSeries.strategies.ActionSerie;
import HelloSeries.metier.Serie;

public class Recherche extends Timer {
	private int time_routine;
	private ActionSerie script;
	private ArrayList<Serie> liste_series;

	private static Logger logger = Logger.getLogger(Recherche.class);

	public synchronized void start (){
		this.schedule(new TimerTask(){
			public void run() {
				try {
					HelloSeries.getInstance().rechercheAll();
				} catch (InterruptedException e) {
					logger.error(e.getMessage());
				}

			}
		}, new Date(), getTime_routine());
	}
	public ArrayList<Serie> getListe_series() {
		return liste_series;
	}
	public void setListe_series(ArrayList<Serie> liste_series) {
		this.liste_series = liste_series;
	}
	public ActionSerie getScript() {
		return script;
	}
	public void setScript(ActionSerie script) {
		this.script = script;
	}
	public int getTime_routine() {
		return time_routine;
	}
	public void setTime_routine(int time_routine) {
		this.time_routine = time_routine;
	}
}
